unit FormaPagamentoDM;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ZDataset, ZSqlUpdate, MainDM, QueryConditions, DB;

type

  { TFormaPagamentoData }

  TFormaPagamentoData = class(TMainDataModule)
    FormaPagamentoDatasource: TDatasource;
    FormaPagamentoZQuery: TZQuery;
    FormaPagamentoZQuerydesc_forma_pagamento: TStringField;
    FormaPagamentoZQuerysigla_forma_pagamento: TStringField;
    FormaPagamentoZUpdate: TZUpdateSQL;
    procedure DataModuleCreate(Sender: TObject);
    /// Abre o DataSet
    procedure OpenDataSet(); override;
    /// Fecha o DataSet
    procedure CloseDataSet(); override;
    /// Realiza busca
    /// @param(Condicoes são as condições para a busca)
    /// @param(Tabela é a tabela no banco de dados)
    procedure Search(Condicoes: TQueryConditions; Tabela: string); override;
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  FormaPagamentoData: TFormaPagamentoData;

implementation

uses ConnectionDM;

{ TFormaPagamentoData }

procedure TFormaPagamentoData.DataModuleCreate(Sender: TObject);
begin
  MainDataSet := FormaPagamentoZQuery;
  FormaPagamentoZQuery.Open;
end;

procedure TFormaPagamentoData.OpenDataSet;
begin
  //ConnectionData.EmptyQuery(FormaPagamentoZQuery, 'forma_pagamento');
end;

procedure TFormaPagamentoData.CloseDataSet;
begin
  // FormaPagamentoZQuery.Close();
end;

procedure TFormaPagamentoData.Search(Condicoes: TQueryConditions; Tabela: string);
begin
  ConnectionData.OpenQueryConditions(FormaPagamentoZQuery, Tabela, Condicoes);
end;

initialization
  {$I formapagamentodm.lrs}

end.


